﻿using System.Windows;

namespace Utils.DialogManagement
{
	public partial class InputDialogControl
	{
		public InputDialogControl(string message)
		{
			DataContext = this;
			Message = message;

			InitializeComponent();

			Loaded += (s, e) => inputTb.Focus();
		}

		#region Message

		public static readonly DependencyProperty MessageProperty =
			DependencyProperty.Register(
				"Message", typeof(string), typeof(InputDialogControl),
				new PropertyMetadata(default(string)));

		public string Message
		{
			get { return (string)GetValue(MessageProperty); }
			set { SetValue(MessageProperty, value); }
		}

		#endregion

		#region Value

		public static readonly DependencyProperty ValueProperty =
			DependencyProperty.Register(
				"Value", typeof(string), typeof(InputDialogControl),
				new PropertyMetadata(default(string)));

		public string Value
		{
			get { return (string)GetValue(ValueProperty); }
			set { SetValue(ValueProperty, value); }
		}

		#endregion
	}
}
